package cn.com.header.zbpk.sys.service;
import cn.com.header.zbpk.sys.entity.Attachment;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import java.io.InputStream;


@Service
public interface IAttachService {
	void writeAndSave(Attachment attach, InputStream input, HttpServletRequest request);

	/**
	 * Web版生成附件的保存路径，不包含根路径。 文件的保存路径格式为：根 + 类型 + 年份 + 时间串 + 文件后缀
	 */
	String generateFileSavePath(String rootPath, String origName, Attachment.Type attachType);


	public Attachment loadAttach(Long id);


	/**
	 * 获取指定附件对应的文件输入流
	 */
	 InputStream getFileInputStream(Long attachId, HttpServletRequest request) throws Exception;

	/**
	 * html导出pdf
	 * @return
	 */
	boolean convertHtmlToPdf(String srcPath, String destPath);

}
